package com.jing.yao.config;

import com.jing.yao.config.converter.YaoJacksonMessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * web全局配置
 * @author lr
 * @since 2020-07-03
 */
public class CustomWebMvcConfigurer implements WebMvcConfigurer {

    @Autowired
    private YaoJacksonMessageConverter yaoJacksonMessageConverter;

    @Override
    public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
        converters.add(0, yaoJacksonMessageConverter);
    }


}
